import { createRouter, createWebHistory } from "vue-router";

// 导入组件  @ 代表 src 目录
import LoginVue from "@/components/Login.vue";
import IndexVue from "@/components/Index.vue"

// 给组件配置访问路径
const routes = [
  {
    path: "/",
    component: LoginVue,
  },
  {
    path: '/index',
    component: IndexVue,
    children:[
      {
        path: "/bed/bedManage",
        component: () => import('@/views/bed/bedManage.vue') // 按需加载，点击这个path时才加载
      }
    ]
  }

];

// 创建路由示例
const router = new createRouter({
  history: createWebHistory(),
  routes: routes,
});
// 导出使用(提供给其它页面使用)
export default router;
